import urllib.request
import urllib.parse
import json
url = 'https://fanyi.baidu.com/sug'
keyword = input('请输入一个单词')
data = {'kw': keyword}
new_data = urllib.parse.urlencode(data).encode('utf-8')
response = urllib.request.urlopen(url=url, data=new_data)
content = response.read().decode('utf-8')
print(json.loads(content))
